{% extends 'ApiCloud/Base/layout.common.html.twig' %}

{% block main %}
    {% include "ApiCloud/Base/inc.head.light.html.twig" with {title:"施工记录",back:1} %}
    {% include "ApiCloud/Base/inc.site.base.html.twig" with {site:""} %}
    <mu-tabs :value.sync="tab" color="amber600" indicator-color="amber600" inverse center>
        <mu-tab>历史记录</mu-tab>
        <mu-tab>添加</mu-tab>
    </mu-tabs>
    <div class="pad5" v-if="tab == 1">
        <mu-form ref="form" :model="en"  label-position="top" label-width="100">

            <div class="fs10 padl5 padr5">

                <mu-form-item label="工作说明" :rules="[rules.notNull]" prop="intro">
                    <mu-text-field v-model="en.intro" multi-line :rows="3" :rows-max="6" ></mu-text-field>
                </mu-form-item>


                <div class="fs10">
                    <mu-form-item label="附件" :rules="[rules.notNull]" prop="content">
                        <div class="ofh">
                            <div class="flex-r flex-nowrap">
                                <mu-paper class="picCommonSize pos-r mar3" :z-depth="1"  v-for="tile, index in pics">
                                    <img class="picCommonSize" :src="tile">
                                    <div class="pos-a w100 r0 l0 b-3 flrc op6">
                                        <mu-button fab small color="black" @click="move(index,-1)">
                                            <mu-icon  value="arrow_back"></mu-icon>
                                        </mu-button>
                                        <mu-button fab small color="black" @click="move(index,1)">
                                            <mu-icon  value="arrow_forward"></mu-icon>
                                        </mu-button>
                                        <mu-button fab small color="black" @click="del(index)">
                                            <mu-icon  value="close"></mu-icon>
                                        </mu-button>
                                    </div>
                                </mu-paper>
                            </div>

                            <div class="">
                                <mu-button color="success" @click="selectPic()">选择照片</mu-button>
                            </div>
                        </div>
                    </mu-form-item>
                </div>

                <div class="fs8 c11 pad5 mart20">
                    <mu-button large full-width round color="primary" @click="submit()">保存提交</mu-button>
                </div>

            </div>
        </mu-form>
    </div>
    <div class="pad5" v-if="tab == 0">
        <div class="fs8 c11">
            <div class="c12 padt5">
                <div class="fs8">
                    <div class=" padt5 bdbso marb10" v-for="item in list">
                        <div class="flrc c11 lh15">
                            <div class="flex1 fs10">[[item.User_realName]]</div>
                            <div class="fs9 c12">[[item.SiteWorkLog_add_Date]]</div>
                        </div>
                        <div>
                            <p>
                                [[item.SiteWorkLog_intro]]
                            </p>
                        </div>
                        <div class="">
                            <div class="flex-r flex-wrap">
                                <mu-paper class="picCommonSize pos-r mar3" :z-depth="1"  v-for="pic,index in item.SiteWorkLog_content">
                                    <img @click="showPic(index,item.SiteWorkLog_content)" class="picCommonSize" :src="pic" >
                                </mu-paper>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

{% endblock %}

    {% block myJs %}

        <script type="text/javascript" src="{{ root }}/assets/oss/lib/crypto1/crypto/crypto.js"></script>
        <script type="text/javascript" src="{{ root }}/assets/oss/lib/crypto1/hmac/hmac.js"></script>
        <script type="text/javascript" src="{{ root }}/assets/oss/lib/crypto1/sha1/sha1.js"></script>
        <script type="text/javascript" src="{{ root }}/assets/oss/lib/base64.js"></script>
        {#<script type="text/javascript" src="{{ root }}/assets/oss/lib/plupload-2.1.2/js/plupload.full.min.js"></script>#}
        <script type="text/javascript" src="{{ root }}/assets/oss/uploadMy.js{{ rnd }}"></script>
    {% endblock %}
